<script type="text/javascript">
  function Person(name,age){
    this.name = name;
    this.age = age;
  }
  Person.prototype.sayName = function(){
    console.log(this.name);
  }
  
  var Student = function (name,age,score){
    //console.log(this);
    //this指向Student，这样继承了来自Person的属性
    Person.call(this,name,age);
    this.score = score;  
  }
  //通过Object.create方法，让Student原型链指向Person.prototype
  Student.prototype =Object.create(Person.prototype)

  //为Student定义属于自己的方法
  Student.prototype.sayScore = function(){
    console.log(this.score);
  }

  //调用
  var myStudent = new Student('qi',22,99);
  console.log(myStudent);
</script>